package com.intretech.tj.light;

import com.intretech.tj.device.Device;
import com.intretech.tj.device.Type;
import lombok.Data;

@Data
public class Light {
    /**
     * 红绿灯id
     */
    private int id;

    /**
     * 状态
     */
    private State state;
    /**
     * 剩余时间
     */
    private int time;

    /**
     * 红灯总时间
     */
    private int redTime;
    /**
     * 绿灯总时间
     */
    private int greenTime;
    /**
     * 黄灯总时间
     */
    private int yellowTime;

    public Light() {
    }

    public Light(int id, State state, int time, int RedTime, int greenTime, int yellowTime) {
        this.id = id;
        this.state = state;
        this.time = time;
        this.redTime = RedTime;
        this.greenTime = greenTime;
        this.yellowTime = yellowTime;
    }

    public Device toDevice() {
        return new Device(id, Type.Light, "", state.getChinese());
    }
}
